<header class="page-header clearfix">
    <h4><a ng-href="#/k8s"><i class="fa fa-arrow-left"></i></a>租户</h4>
    <div class="toolbox">
        <a ui-sref="create.basemsg({kDbCode:list.dbCode})"><i class="fa fa-plus"></i>创建租户</a>
    </div>
    <ol class="breadcrumb">
        <li><a ng-href="#/k8s">容器集群</a></li>
        <li class="active">租户</li>
    </ol>
</header>
<section>
    <ui-panel class="panel-list">
        <form class="form-inline form-search" ng-submit="list.search()">

            <div class="form-group">
                <input type="text" maxlength="50" ng-model="list.filter.name" class="form-control" placeholder="请输入租户名称查询" />
            </div>
            <div class="form-group">
                <input type="text" maxlength="50" ng-model="list.filter.code" class="form-control" placeholder="请输入租户编码查询"/>
            </div>
            <button class="btn btn-default" type="submit">查询</button>
        </form>
        <table class="table table-hover">
            <thead>
                <tr>
                    <th width="12%">租户名称</th>
                    <th width="12%">租户编码</th>
                    <th width="12%">CPU</th>
                    <th width="12%">内存</th>
                    <th width="12%">应用数</th>
                    <th width="12%">容器数</th>
                    <th width="20%">创建时间</th>
                    <th width="50">更多</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="elem in list.table"  ng-init="list.getCpus(elem)">
                    <td>{{::elem.namespaceName}}
                        <div class="loading-sm pull-right" ng-show="list.deleting"></div>
                    </td>
                    <td>{{::elem.namespaceCode}}</td>
                    <td >
                        <ui-progressbar max="100" value="elem.usedCpu" type="success"><span class="progress-label-center">{{elem.usedCpu}}%</span>
                            <span class="progress-label-right">{{::elem.cpuQuota}}核</span></ui-progressbar>
                    </td>
                    <td>
                        <ui-progressbar max="elem.memoryQuota" value="elem.usedMemory" type="info">
                            <span class="progress-label-center">{{elem.usedMemory}}/{{elem.memoryQuota}} MB</span>
                        </ui-progressbar>
                    </td>
                    <td>
                        <ui-progressbar max="elem.rcQuota" value="elem.usedRcs" type="primary">
                            <span class="progress-label-center">{{elem.usedRcs}}/{{::elem.rcQuota}}</span>
                        </ui-progressbar>
                    </td>
                    <td>
                        <ui-progressbar max="elem.podQuota" value="elem.usedPods" type="warning">
                            <span class="progress-label-center">{{elem.usedPods}}/{{::elem.podQuota}}</span>
                        </ui-progressbar>
                    </td>
                    <td>{{::elem.createTime | date:'yyyy-MM-d HH:mm:ss'}}
                        <span ng-show="elem.status=='001'" class="text-primary">创建中</span>
                        <span ng-show="elem.status=='002'" class="text-success">创建成功</span>
                        <span ng-show="elem.status=='003'" class="text-danger">创建失败</span>
                    </td>
                    <td class="text-center more-action">
                        <div uib-dropdown>
                            <a uib-dropdown-toggle><i class="fa fa-ellipsis-h fa-lg" /></a>
                            <ul class="dropdown-menu animate fade-in-down" style="margin-bottom: 30px">
                                <!--<li>
                                    <a ng-click="list.lessee_edit(elem)"><i class="fa fa-edit"></i><span class="margin-left-10">编辑</span></a>
                                </li>-->
                                <li>
                                    <a ng-click="list.delete(elem)"><i class="fa fa-trash-o"></i><span class="margin-left-10">删除</span></a>
                                </li>
                                <li>
                                    <a ng-click="list.openLogForm('namespaceYaml',elem.namespaceYaml)"><i class="fa fa-file-text"></i><span class="margin-left-10">查看namespaceYaml</span></a>
                                </li>
                                <li>
                                    <a ng-click="list.openLogForm('quotaYaml',elem.quotaYaml)"><i class="fa fa-file-text"></i><span class="margin-left-10">查看quotaYaml</span></a>
                                </li>
                                <li>
                                    <a ng-click="list.openLogForm('quotaYaml',elem.limitsYaml)"><i class="fa fa-file-text"></i><span class="margin-left-10">查看limitsYaml</span></a>
                                </li>
                            </ul>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
        <!--Loading-->
        <div class="loading" ng-show="!list.table"></div>
        <!--分页-->
        <div ng-show="list.table" class="pagination-group">
            <ui-pagination-info items-per-page="10" items-per-page-select="false" total-items="list.page.totalItems" current-page="list.page.currentPage"></ui-pagination-info>
            <button type="button" ng-click="list.getList()" class="btn btn-default btn-refresh"><i class="fa fa-refresh"></i></button>
            <ui-pagination items-per-page="10" total-items="list.page.totalItems" ng-model="list.page.currentPage" ng-change="list.getList()"></ui-pagination>
        </div>
    </ui-panel>
</section>